.jenkins-spinner {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;

  &::before,
  &::after {
    content: "";
    display: inline-block;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 100%;
    border: 0.175rem solid currentColor;
  }

  &::before {
    position: relative;
    margin-right: 0.75rem;
    opacity: 0.2;
    align-self: flex-start;
  }

  &::after {
    position: absolute;
    top: 0;
    left: 0;
    clip-path: inset(0 0 50% 50%);
    animation: loading-spinner 1s infinite linear;

    @media (prefers-reduced-motion) {
      animation-duration: 2s;
    }
  }

  &:empty {
    &::before {
      margin-right: 0;
    }
  }
}

@keyframes loading-spinner {
  to {
    transform: rotate(360deg);
  }
}

.behavior-loading {
  position: fixed;
  display: flex !important;
  align-items: center;
  justify-content: center;
  inset: 0;
  z-index: 999;
  backdrop-filter: blur(15px);
  transition: var(--standard-transition);

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--background);
    opacity: 0.95;
  }

  .jenkins-spinner {
    animation: fade-in-jenkins-spinner 0.4s ease;
  }

  &--hidden {
    opacity: 0;
    visibility: collapse;
    pointer-events: none;

    .fade-in-jenkins-spinner {
      opacity: 0.5;
      transform: scale(0.75);
    }
  }
}

@keyframes fade-in-jenkins-spinner {
  from {
    opacity: 0.5;
    transform: scale(0.75);
  }
}
